package com.qgs.secsgem.secs.entity.common;

import com.alibaba.fastjson.annotation.JSONType;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @Desc: ""
 * @Author: caixiang
 * @DATE: 2023/4/28 14:42
 */
@Data
@JSONType(orders={"trid","tridType","dsper","totsmp","totsmpType","repgsz","repgszType","vidList","vidType"})
public class TraceNode {
    //S2F23 trace data初始化的时候是有个TRID的，这个TRID是和后面S6F1的TRID对应的。(Trace request ID.)
    private String trid;
    private String tridType;
    //Data sample period. DSPER has two allowable formats Format 1: hhmmss, 6 bytes Format ; 2: hhmmsscc, 8 bytes
    //<A "000002">	//DSPER 不行就试下8位 00000200 2s给一次
    //dsper 只能ASCII 类型
    //type ==1 或者 2
    private String dsper;


    //一共trace 的次数，如果 totsmp设置为0，就代表TraceDataTerminate
    private Integer totsmp;
    private String totsmpType;

    //REPGSZ reporting group size
    //每个dsper时间间隔，，会发送2次数据（vidList）过来, 一般都是 repgsz=1
    private Integer repgsz;
    private String repgszType;

    private List<String> vidList;
    private String vidType;


    public TraceNode(String trid, String tridType, String dsper, Integer totsmp, String totsmpType, Integer repgsz, String repgszType, String vidType) {
        this.trid = trid;
        this.tridType = tridType;
        this.dsper = dsper;
        this.totsmp = totsmp;
        this.totsmpType = totsmpType;
        this.repgsz = repgsz;
        this.repgszType = repgszType;
        this.vidType = vidType;
        this.vidList = new ArrayList<>();
    }

    public TraceNode(String trid, String tridType, String dsper, Integer totsmp, String totsmpType, Integer repgsz, String repgszType, String vidType,List<String> vidList) {
        this.trid = trid;
        this.tridType = tridType;
        this.dsper = dsper;
        this.totsmp = totsmp;
        this.totsmpType = totsmpType;
        this.repgsz = repgsz;
        this.repgszType = repgszType;
        this.vidType = vidType;
        this.vidList = vidList;

    }

    public TraceNode() {
    }
}
